package 多线程和队列.oom;

import java.nio.ByteBuffer;

/**
 * 直接内存溢出 NIO使用Buffer
 *
 * @author 孔令富  2021/12/21
 */
public class DirectBufferMemoryTest {

    //-Xms10M -Xmx10M -XX:+PrintGCDetails -XX:MaxDirectMemorySize=5M
    public static void main(String[] args) {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException exception) {
            exception.printStackTrace();
        }
        ByteBuffer.allocateDirect(6 * 1024 * 1024);
    }
}
